home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c
- Subject: Re: What to do when feof() is NOT feof()
- Date: 22 Feb 1996 19:47:28 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4gj6bg$mrv@solutions.solon.com>
- References: <4g7rsj$fnf@spectator.cris.com> <1996Feb19.063026.29889@zcon.com> <4gb7r3$p4k@sun001.spd.dsccc.com>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4gb7r3$p4k@sun001.spd.dsccc.com>,
- Mike McCarty <jmccarty@spd.dsccc.com> wrote:
- >)Note that even the EOF result returned (look in stdio.h) has nothing to
- >)do with the actual byte at the end of the file.
-
- >Yes, it does, on some systems. This is a very strong statement for you
- >to make, especially in light of the next statement.
-
- No, it doesn't. Not on *any* system. Why? Because EOF is a negative
- integer constant, and getchar/getc/fgetc all return the next available
- character *as an unsigned char* or EOF. EOF can *NEVER* be the same
- as *ANY* character in the file, nor can it be the byte at the end of
- a file. (Unless your implementation has int and char be the same size, and
- all possible values of int are legal char values as well, but this may
- not be allowed by the standard, and is certainly not going to be seen
- as a quality implementation.)
-
- So no, EOF does *not* have anything to do with the byte at the end of the
- file. :)
-
- >It would be a lot calmer and more fun to read this group if people could
- >treat each other with a normal dose of courtesy.
-
- Yup. The question is, when someone rudely barges into a C user's group
- meeting and starts discussing stuff specific to something other than C,
- does this violation of courtesy entitle us to be rude to them? I think
- so, although I prefer not to be rude anyway.
-
- --
- Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.txt
-